/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pruebarepositorios.Interfaz;
import javax.swing.*;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.*;

public class Dibujo extends Canvas  {

    ArrayList<int[]> puntos;
    
    public Dibujo(ArrayList<int[]> puntos) {
        this.puntos = puntos;
        this.setSize(298,198);
    }

    public void paint(Graphics g) {
        g.setColor(Color.BLACK);
        g.drawLine(1, this.getHeight(), 298, this.getHeight());
        for (int i = 0; i < puntos.size(); i++) {
            g.drawRect(puntos.get(i)[0], this.getHeight()-puntos.get(i)[1]-3, 2, 2);
        }
    }

    public void actualizar(ArrayList<int[]> puntos){
        this.puntos = puntos;
    }
}
